﻿using System;

class RandNum
{
    public static void Main(string[] args)
    {
        Random random = new Random();
        int[] a = new int[100];

        for (int i = 0; i < 100; i++)
        {
            a[i] = random.Next(1000) + 1;
        }

        var query = from i in a
                    select i;
        double sum = query.Sum();
        Console.WriteLine(sum);
        double average = query.Average();
        Console.WriteLine(average);
    }
}